
#ifndef RTSPSERVER_H
#define RTSPSERVER_H

#include <QObject>
#include <QTcpServer>
#include <QMap>

class RtspSession;
class QTcpSocket;

class RtspServer : public QTcpServer
{
    Q_OBJECT
public:
    explicit RtspServer(QObject *parent = nullptr);
    bool start(quint16 port);

protected:
    void incomingConnection(qintptr socketDescriptor) override;

private slots:
    void onClientDisconnected();

private:
    QMap<QTcpSocket*, RtspSession*> m_clients;
};
#endif // RTSP_SERVER_H
